package com.service;

import com.dao.AdminDAO;
import com.pojo.Admin;
import com.util.PasswordUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

@Service
public class AdminService {

    @Autowired
    private AdminDAO adminDAO;

    /**
     *  后台登录
     * @param username
     * @param password
     * @return
     */
    public Admin login(String username, String password) {
        //密码加密
        String jiami_password = PasswordUtil.jiami(password);
        System.out.println(jiami_password);
        Admin admin = (Admin)adminDAO.findAdminByUsernameAndPassword(username,jiami_password);
        return admin;
    }

}
